import { _decorator, Component, math, Node, UITransform } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('TopBarUI')
export class TopBarUI extends Component {
    @property(Node)
    hpMask: Node;
    @property(Node)
    arrow: Node;
    start() {
        this.arrow.active = false
    }

    setValue(val: number) {
        this.hpMask.getComponent(UITransform).contentSize = math.size(val * 150, 16);
    }

    update(deltaTime: number) {

    }

    showArrow() {
        this.arrow.active = true
    }

    hidArrow() {
        this.arrow.active = false
    }
}


